package com.jingdianjichi.auth.common.enums;

import lombok.Generated;
import lombok.Getter;

@Getter
public enum ResultEnumCode {
    SUCCESS(200, "成功"),
    FAIL(500, "失败");

    private int code;
    private String desc;

    ResultEnumCode(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    public static ResultEnumCode getResultEnumCode(int code) {
        for (ResultEnumCode result : ResultEnumCode.values()) {
            if (result.code == code) {
                return result;
            }

        }
        return null;
    }
}